import router from '@system.router';
import prompt from '@system.prompt';
import { currentUser, outLogin } from "../../service.js"

export default {
    data: {
        userinfo: null
    },
    async onInit() {
        this.userinfo =  await currentUser();
    },
    typeClick(){
        router.push({
            uri: "pages/event-type/event-type",
        });
    },
    async logoutClick(){
        if (await outLogin()) {
            router.push({ uri: "pages/login/login" });
        }
    },
    feedbackClick(){
        prompt.showToast({
            message: '开发中',
            duration: 2000,
        });
    },
    loggerClick(){
        prompt.showToast({
            message: '开发中',
            duration: 2000,
        });
    },
    checkClick(){
        prompt.showToast({
            message: '开发中',
            duration: 2000,
        });
    },
    aboutClick(){
        prompt.showToast({
            message: '开发中',
            duration: 2000,
        });
    },
    back() {
        router.back()
    }
}
